Repository navigation
fix(ui): keep creatable tag fields from opening an empty Autocomplete - #35419
shrabantipaul-collate wants to merge 10 commits into
Conversation
react-stately reopens the ComboBox menu from a passive effect when the
input value changes, and that update renders in a later task. Typing,
pressing Enter and moving to the next field quickly can blur the input
first, so the open lands on an unfocused combobox that no later blur
closes. While open, react-aria's useComboBox runs ariaHideOutside — even
for hideDropdown tag fields with no popover — so the rest of the page and
every node added afterwards is aria-hidden.
That made "Data Contracts > Add and update Security and SLA tabs" flaky:
the Identities tag field stayed open, the newly added row filter was
aria-hidden, and getByRole('combobox') never resolved.
Close the combobox whenever it is open without focus, and only reopen on
mousedown when the input is already focused (an unfocused input opens on
the focus the press causes).
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…t role A creatable tag field left open after a fast type-Enter-move aria-hides the rest of the page, and role queries skip aria-hidden nodes, so the column picker in the Security tab could never be found. Locate the input, option and chip button by test id and attributes instead.
A creatable tag field (hideDropdown) has no list, but it still opened on focus and on every keystroke. While open, react-aria reports aria-expanded="true" and aria-hides the rest of the page, including nodes added later, so screen readers and role queries lost the form whenever the field was focused — and a fast type-Enter-move could leave it stuck open. - hideDropdown fields use menuTrigger="manual" and our own ArrowDown and mousedown handlers no longer open them; Enter in them never submits the surrounding form. - The open guard now also closes a field without a dropdown that react-aria's own arrow-key or touch handlers opened. With the root cause fixed in the component, the Data Contract test helper goes back to role-based lookups, which check what assistive tech sees.
…e closes The Autocomplete fix keeps a combobox open only while its input is focused. TestDefinitionFormBody and Assignees opened it with synthetic mouseDown/focus events that never move focus in jsdom, so their option lists never rendered; click the input with userEvent instead. The race tests asserted the collapsed state at a fixed 50ms settle, but the passive effect that closes a late open can land after it on a loaded runner; wait for the collapse instead.
The previous fix kept tag fields (hideDropdown) closed with menuTrigger="manual" plus hideDropdown checks in our ArrowDown, mousedown and close-effect handlers. react-aria's own arrow-key and touch handlers still opened the field for one render before the effect closed it, which flashed aria-expanded and aria-hid the page. A tag field now passes no items and disallows an empty collection, so react-stately refuses every open at the source. Main's menuTrigger="focus" and ArrowDown handler come back unchanged, and the close effect reduces to one rule: close when the input is not focused.
…ta-flaky-run-fix' into shrabantipaul-collate/openmetadata-flaky-run-fix
Review asked to leave the core Autocomplete untouched, so this reverts every core change on the branch and fixes the bug where the fields are used. A creatable tag field (hideDropdown) has no list, but core opens it on focus and on every keystroke. While open, react-aria aria-hides the rest of the page, and a fast type → Enter → move-on could leave it stuck open after blur, so role queries (and screen readers) lost the form. Each tag field now spreads TAG_INPUT_COMBOBOX_PROPS (menuTrigger: 'manual', allowsEmptyCollection: false), which core already forwards to the react-aria ComboBox: focus and typing never open it, and react-stately closes an empty list that a click or arrow key opened. Applied to the Data Contract security form, glossary term form and synonyms editor, task form builder options, and the SSO and workflow array templates when they have no options. The jest updates to TestDefinitionFormBody and Assignees only existed for the reverted core close-on-blur effect and go back to main too.
|
| Count | Rule |
|---|---|
| 9 | react-hooks/exhaustive-deps |
| 1 | openmetadata-imports/no-cross-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/DataContract/ContractSecurityFormTab/ContractSecurityFormTab.tsx:367:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'columnItems' and 'form'. Either include them or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/GlossaryTermSynonyms.tsx:165:9 |
react-hooks/exhaustive-deps |
The 'getSynonyms' function makes the dependencies of useCallback Hook (at line 268) change on every render. Move it inside the useCallback callback. Alternative |
| 🟡 | src/components/SettingsSso/SSOConfigurationForm/SsoConfigurationFormArrayFieldTemplate.tsx:149:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when any prop changes |
| 🟡 | src/components/SettingsSso/SSOConfigurationForm/SsoConfigurationFormArrayFieldTemplate.tsx:179:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when any prop changes |
| 🟡 | src/components/SettingsSso/SSOConfigurationForm/SsoConfigurationFormArrayFieldTemplate.tsx:198:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when any prop changes |
| 🟡 | src/components/SettingsSso/SSOConfigurationForm/SsoConfigurationFormArrayFieldTemplate.tsx:204:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when any prop changes |
| 🟡 | src/components/common/Form/JSONSchema/JSONSchemaTemplate/WorkflowArrayFieldTemplate.tsx:75:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has an unnecessary dependency: 'value'. Either exclude it or remove the dependency array. |
| 🟡 | src/components/common/Form/JSONSchema/JSONSchemaTemplate/WorkflowArrayFieldTemplate.tsx:102:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when any prop changes |
| 🟡 | src/components/common/Form/JSONSchema/JSONSchemaTemplate/WorkflowArrayFieldTemplate.tsx:115:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when any prop changes |
| 🟡 | src/pages/TaskFormSettingsPage/components/TaskFormBuilderSection.tsx:50:1 |
openmetadata-imports/no-cross-page-imports |
Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
Code Review ✅ Approved🟡 Medium risk · Applying manual, no-empty-list behavior to tag Autocomplete fields across several forms could disrupt expected keyboard interactions. Adds VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Pull request was closed



Describe your changes:
Fixes the flaky
Data Contracts › Add and update Security and SLA tabstest (DataContracts.spec.ts:1919), which failed in merge-queue run 38518715793.Issue: The Identities tag field could stay "open" after the test typed, pressed Enter and moved on. While a combobox is open, react-aria marks the rest of the page
aria-hidden, including the new row filter added afterwards. Playwright'sgetByRole('combobox')couldn't find that row and timed out.Cause: A creatable tag field (
hideDropdown) has no list, but the coreAutocompletestill opened it on focus and on every keystroke. So whenever a tag field had focus, the rest of the page was hidden from screen readers and from role queries, and the field reportedaria-expanded="true". On top of that, react-stately reopens the menu a moment after the text changes. A fast type → Enter → move-on can blur the field before that reopen lands, leaving it stuck open.Where it started: #35217 moved the Data Contract security form from antd
Select mode="tags"to coreAutocompletetag fields (allowsCreation+hideDropdown). The other tag fields (glossary term form and synonyms editor, task form builder options, and the SSO and workflow array fields when they have no options) have the same bug. Their tests didn't catch it because they look elements up withgetByTestId, which still matches hidden elements.Fix (at the call sites — the core
Autocompleteis unchanged):Every creatable tag field spreads a shared
TAG_INPUT_COMBOBOX_PROPS(constants/Form.constants.ts):Core already forwards these to the react-aria
ComboBox. With them, focus and typing never open a tag field. That includes the late reopen after blur that caused the flake. react-stately also closes an empty list that a click or ArrowDown opened, so a tag field can no longer stay open. A click or ArrowDown still opens it for one render before that close; removing that last flash would need a core change.Applied to: Data Contract security form (
tagField), glossary term form and synonyms editor, task form builder options, and the SSO and workflow array templates when they have no options.The test helper keeps its role-based lookups, so it checks what assistive tech sees.
Type of change:
Tests:
Unit (
ContractSecurityFormTab.test.tsx, new test): click into Identities, type a value, press Enter, then ArrowDown. A chip is added, the field stays collapsed, the rest of the form is still reachable by role (role queries skiparia-hiddennodes), and the form isn't submitted. It fails on main (aria-expanded="true") and without the call-site props.App unit tests for every touched area pass: 117 suites, 1444 tests (Data Contract, Glossary, SSO, common forms, task form settings, TestDefinitionForm, Assignees, custom properties).
Playwright, run locally against this branch with retries off, each test ×10 (3 workers): all 30 runs passed, plus setup and teardown, in 4.4 min.
DataContracts.spec.ts:1919, Security and SLA tabs: 10/10.DataContractInheritance.spec.ts:637, Add SLA when inheriting: 10/10.GlossaryTermDetails.spec.ts:45, add and remove synonyms: 10/10.Playwright output for that run (commit
e6e2580d354):UI screen recording:
Not applicable — bug fix with no visual change.
Checklist:
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were found.Summary
Keeps creatable tag fields from opening an empty
Autocompleteon focus or typing.No actionable issues were found.
Reviews (2) · Last reviewed commit: "Merge branch 'main' into shrabantipaul-c..." · Reviewed by Greptile